//
//  MJDataGroup.m
//  测试1.1
//
//  Created by 王志盼 on 15/2/4.
//  Copyright (c) 2015年 王志盼. All rights reserved.
//

#import "MJDataGroup.h"
#import "MJTextData.h"

@implementation MJDataGroup
- (instancetype)initWithDict:(NSDictionary *)dict
{
    if (self = [super init]) {
        self.groupName = dict[@"groupName"];
        
        NSMutableArray *tmpArray = [[NSMutableArray alloc] init];
        NSArray *articles = dict[@"article"];
        for (NSDictionary *tmpDict in articles) {
            MJTextData *p = [MJTextData textDataWithDict:tmpDict];
            [tmpArray addObject:p];
        }
        self.articles = tmpArray;
    }
    return self;
}
+ (instancetype)dataGroupWithDict:(NSDictionary *)dict
{
    return [[self alloc] initWithDict:dict];
}
@end